home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
hacklist
/
94-04.Z
/
94-04
/
000001_rcq@mailserv-D.ftp.com_Thu Apr 3 04:47:47 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-04-30
|
2KB
Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA13125; Thu, 31 Mar 1994 09:48:35 -0500
Received: from mailserv-D.ftp.com by ftp.com ; Thu, 31 Mar 1994 09:48:34 -0500
Received: from rcq.oysters.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
id AA11710; Thu, 31 Mar 94 09:47:47 EST
Date: Thu, 31 Mar 94 09:47:47 EST
Message-Id: <9403311447.AA11710@mailserv-D.ftp.com>
To: paul@atlas.abccomp.oz.au
Subject: Re: What does send() returning 0 mean ? revisited
From: rcq@ftp.com (Bob Quinn)
Reply-To: rcq@ftp.com
Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
Sender: rcq@mailserv-D.ftp.com
Repository: mailserv-D.ftp.com, [message accepted at Thu Mar 31 09:47:34 1994]
Originating-Client: oysters.ftp.com
Content-Length: 1519
> I'd like to conduct a straw-poll please, on the expected behaviour
> of calling send() with a zero length - this seems to be one
> case that different stacks handle quite differently, and there is currently
> no guidance in the specification.
>
> My thoughts are that this is a perfectly valid, though not
> particularly useful, thing to do, and that this is the only time it
> is valid for send() to return 0 - which indicates success, 'cause the
> number of bytes able to be written == number of bytes requested.
> Other stacks seem to call this an error, and Trumpet Winsock returns
> SOCKET_ERROR with error code WSAEINVAL (Invalid Argument) [ although the
> Error Codes section for send() indicates WSAEINVAL means "The socket
> has not been bound with bind()"]
>
> Comments from others, both stack developers and application
> developers, please ....
Since there is no obvious reason to reject a length of zero (it's
not a useful request, but it's not a harmful one), we return 0.
We did this partly because the spec is not clear on the issue,
but also because we try to work on the philosophy that a function
should not fail without good reason. Since there are unforeseen
conditions under which an application can sometimes mistakenly
try to send 0 bytes, there's no reason for the DLL to punish
them for it.
Regards,
--
Bob Quinn rcq@ftp.com
FTP Software, Inc. No. Andover, MA